<template>
  <div id="lux-header">
    <div class="img-wrap"><img src="../assets/icons/logo.png"
           alt=""></div>
    <div class="title">
      <i v-show="title === 'Viewing Product'"
         class="iconfont icon-flow"
         @click="backProductList"></i> {{title}}
    </div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";

export default {
  data() {
    return {};
  },
  computed: {
    ...mapGetters(["title"])
  },
  methods: {
    backProductList() {
      this.$store.commit("productChange", { title: "Market Analysis" });
    }
  }
};
</script>

<style lang="scss">
@import "../assets/styles/color.scss";

#lux-header {
  height: 50px;
  & > div {
    display: inline-block;
    &.img-wrap {
      position: absolute;
      text-align: center;
      height: 73px;
      margin-top: 17px;
      width: 64px;
      z-index: 100;
      img {
        height: 100%;
        width: 100%;
        height: 50px;
        width: 50px;
      }
    }
  }
  text-align: left;
  line-height: 50px;
  color: #fff;
  background-color: $headColor;
  .title {
    text-indent: 70px;
    height: 50px;
    line-height: 50px;
    i {
      margin-left: 10px;
      margin-right: 5px;
      font-size: 24px;
      &:hover {
        color: $base;
      }
    }
  }
}
</style>
